package com.example.springsession.starterautoconfig.annotation;

import com.example.springsession.starterautoconfig.config.LogFilterAutoConfiguration;
import org.springframework.context.annotation.Import;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 自定义注解使自动注入能够生效
 *  zj：1、入口 扫描 @EnableLogFilter  导入 Import 配置类
 *   2、配置类注解 ConditionalOnClass 加载bean   class LogFilterRegistrationBean extends FilterRegistrationBean<LogFilter>
 *    LogFilterRegistrationBean 中添加过滤器--
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
// 引入LogFilterAutoConfiguration 配置类
@Import(LogFilterAutoConfiguration.class)
public @interface EnableLogFilter {
}
